package org.tech4j.edi.api.factory;

import org.tech4j.common.spi.SPI;
import org.tech4j.edi.common.RetryHandle;

import java.util.Collections;
import java.util.List;

/**
 * @program: tech4j
 * @description:
 * @author: YuKai Fan
 * @create: 2025/3/7 21:19
 **/
@SPI
public interface RetryHandleFactory {

    /**
     * 注册处理器
     * @param bizType bizType
     * @param retryHandle retryHandle
     */
    default void registerHandle(final String bizType, final RetryHandle retryHandle) {}

    /**
     * 获取处理器
     * @param bizType
     * @return
     */
    RetryHandle getRetryHandle(final String bizType);

    /**
     * 获取处理器
     * @param handleClass
     * @return
     */
    default RetryHandle getRetryHandle(final Class<? extends RetryHandle> handleClass) {
        return null;
    }

    default List<String> getRetryType() {
        return Collections.emptyList();
    }
}
